<%-- 
    Document   : QuanLySanPham
    Created on : Dec 4, 2012, 1:13:27 PM
    Author     : NGUYEN DANG
--%>

<%@page import="All.DTO.NhomsanphamDTO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="All.utility.UserManagerProperties"%>
<%@page import="All.DTO.AccountBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
	AccountBean user = (AccountBean) session.getAttribute("UserBean");
	if ((user == null) || (!user.getRole().equals(UserManagerProperties.ADMIN_ROLE))) {
		response.sendRedirect("./DangNhap.jsp");
	}
	ArrayList<NhomsanphamDTO> list = (ArrayList) request.getAttribute("NhomsanphamList");
%>

<!DOCTYPE html>
<html>
    <head>
        <title>Info Management</title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="./css/style.css" />
        <!-- modernizr enables HTML5 elements and feature detects -->
        <script type="text/javascript" src="./js/modernizr-1.5.min.js"></script>
    </head>    
    <body>
        <div id="main">
            <header>
                <jsp:include page="./file/header.jsp"></jsp:include>
            </header>
            <div id="site_content">
                <jsp:include page="./file/LeftMenu.jsp"></jsp:include>
                <div class="content">
                    <form id="contact" action="#" method="post">
                        <div class="form_settings">
                            <h1>The list of Group Item</h1>
                            
                            <table>
                                <tr>
                                        <td>Nhóm Sản Phẩm</td>
                                        <td>Tên Nhóm</td>
                                                                                                                        
                                </tr>
                                <%
                                for (int i=0; i< list.size(); i++) {
                                        NhomsanphamDTO nhomsanphamDTO = list.get(i);
                                %>
                                <br><tr>
                                    <td><%=nhomsanphamDTO.getIDNhomSP()%></td>
                                    <td><%=nhomsanphamDTO.getTennhom()%></td>                                  
                                    <td><a href="./ProcessItemsServlet?id=<%=nhomsanphamDTO.getIDNhomSP()%>">Manage</a></td>                                
                                    </tr>
                                <%	
                                }
                                %>
                            </table>
                        </div>
                    </form>
                </div>
            </div>           
            <footer>
                <jsp:include page="./file/footer.jsp"></jsp:include>
            </footer>
        </div>
        <p>&nbsp;</p>
  <!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="./js/jquery.sooperfish.js"></script>
  <script type="text/javascript" src="./js/image_fade.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $('ul.sf-menu').sooperfish();
    });
  </script>
    </body>
</html>
